package com.SunSoft.PhoneRemoteControl;

import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.widget.Toast;

final class bk
  implements DialogInterface.OnClickListener
{
  public final void onClick(DialogInterface paramDialogInterface, int paramInt)
  {
    paramDialogInterface = MainControl.i(bh.a(this.a.a)).rawQuery("select ID,define_ID,control_type,name_ch,name_en,brand_ch,brand_en,control_model  from control_list where ID = ?", new String[] { String.valueOf(bh.a(this.a.a).T) });
    if (paramDialogInterface.moveToNext())
    {
      paramDialogInterface = paramDialogInterface.getString(paramDialogInterface.getColumnIndex("define_ID"));
      if (MainControl.i(bh.a(this.a.a)).rawQuery("select ID,define_ID,control_type,name_ch,name_en,brand_ch,brand_en,control_model  from control_list where define_ID = ?", new String[] { paramDialogInterface }).getCount() == 0)
        MainControl.i(bh.a(this.a.a)).execSQL("delete   from button_data where define_ID = ?", new String[] { paramDialogInterface });
    }
    Toast.makeText(bh.a(this.a.a), bh.a(this.a.a).getString(2131099802), 0).show();
    MainControl.i(bh.a(this.a.a)).execSQL("delete   from control_list where ID = ?", new String[] { String.valueOf(bh.a(this.a.a).T) });
    if (MainControl.d)
      return;
    bh.a(this.a.a).b();
  }
}